package cn.yanglq.Rss.web.service.impl;

import cn.yanglq.Rss.web.dao.UserMapper;
import cn.yanglq.Rss.web.model.User;
import cn.yanglq.Rss.web.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Created by yanglq on 2017/6/13.
 */
@Service
public class RegisterServiceImpl implements RegisterService {

    @Autowired
    private UserMapper userMapper;

    public void userRegister(String name, String password, String email, String username, String phoneno) {
        User user = new User();
        user.setUserid(name);
        user.setPasswd(password);
        user.setEmail(email);
        user.setUsername(username);
        user.setMobilenumber(phoneno);
        user.setRegtime(new Date());
        userMapper.insert(user);
    }

    public User searchUser(String name) {
        return userMapper.selectByPrimaryKey(name);
    }
}
